package com.sau.pixelcart.domain.entity;

import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

/**
 * <p>
 * 订单商品明细（建议按月分表存储）
 * </p>
 *
 * @author Inton
 * @since 2025-03-27
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("order_detail")
@ApiModel(value="OrderDetail对象", description="订单商品明细（建议按月分表存储）")
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class OrderDetail implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "明细项标识")
    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private String id;

    @ApiModelProperty(value = "关联主订单")
    @TableField("order_id")
    private String orderId;

    @ApiModelProperty(value = "关联商品表")
    @TableField("product_id")
    private String productId;

    @ApiModelProperty(value = "冗余名称（防商品更名）")
    @TableField("product_name")
    private String productName;

    @ApiModelProperty(value = "正数为购买，负数为退货")
    @TableField("number")
    private Integer number;

    @ApiModelProperty(value = "交易时单价快照")
    @TableField("unit_price")
    private BigDecimal unitPrice;

    @TableField("total_price")
    private BigDecimal totalPrice;


}
